<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title  th:text="${questionTitel +'-陕西继续教育服务中心'}">陕西继续教育服务中心-易答文库</title>
    <th:block th:include="adultexam/include"/>
    <link rel="stylesheet" href="/adultexam/css/resect.css">
    <link rel="stylesheet" href="/adultexam/css/easywk.css">
    <link rel="stylesheet" href="/adultexam/css/public.css">

</head>

<body>
<div class="index">
    <div class="content">
        <div th:replace="adultexam/header"></div>
        <div class="bg-content">
            <div class="container">

                <div class="answerContent">
                    <div class="input-group mb-3 searchAnswer">
                        <input type="text" class="form-control" placeholder="输入要搜索的科目(非必填)" aria-label="输入要搜索的科目(非必填)"
                               aria-describedby="button-addon2" id="course" th:value="${course}">
                        <input type="text" class="form-control" placeholder="输入要搜索的题目" aria-label="输入要搜索的题目"
                               aria-describedby="button-addon2" id="keyword" th:value="${keyword}" onkeydown="if(event.keyCode==13) {  $('#button-addon2').click()}">
                        <div class="input-group-append">
                            <button class="btn btn-outline-secondary" type="button" id="button-addon2">搜索答案</button>
                        </div>
                    </div>
                </div>


                <div class="answerContent">
                    <div class="answerContent-hd">
                        搜索结果
                    </div>
                    <ul class="answer-list ">
                        <li class="answer-list-item" th:each="item,temp:${questionList}">
                            <a class="answer-title"   th:utext="${'题目:'+item.questionBody}">题目题目题目题目题目题目</a>
                            <!--th:text="${item.answer}"-->
                            <span class="answer-value" th:utext="${userId!=0 ? item.answer :'登录后查看答案。'} ">登录后查看答案。</span>
                        </li>
                        <li class="answer-list-item" th:if="${questionList.size()}==0">
                            <span class="answer-title">请输入题目进行搜索</span>
                        </li>
                    </ul>
                </div>
                <div class="answerContent">
                    <div class="answerContent-hd">
                        最新题目
                    </div>
                    <ul class="answer-list "  th:if="${questionPage}!=null">
                        <li class="answer-list-item" th:each="item,temp:${questionPage.records}">
                            <a class="answer-title" th:utext="${'题目:'+item.questionBody}"   th:href="${'/easywk?id='+item.id}">题目题目题目题目题目题目</a>
                            <!--th:text="${item.answer}"-->
                            <span class="answer-value"  th:utext="${userId!=0 ?item.answer :'登录后查看答案。'}">登录后查看答案。</span>
                        </li>
                    </ul>
                    <nav aria-label="翻页">
                        <ul class="pagination">
                            <li class="page-item"><a class="page-link" href="/easywk?current=1">第一页</a></li>
                            <li class="page-item"><a class="page-link"
                                                     th:href="${'/easywk?current='+(current+1)}"
                                                     th:text="${(current+1)}">1</a></li>
                            <li class="page-item"><a class="page-link"
                                                     th:href="${'/easywk?current='+(current+2)}"
                                                     th:text="${(current+2)}">2</a></li>
                            <li class="page-item"><a class="page-link"
                                                     th:href="${'/easywk?current='+(current+3)}"
                                                     th:text="${(current+3)}">3</a></li>
                            <li class="page-item"><a class="page-link"
                                                     th:href="${'/easywk?current='+(current+4)}"
                                                     th:text="${(current+4)}">4</a></li>
                            <li class="page-item"><a class="page-link"
                                                     th:href="${'/easywk?current='+(current+5)}"
                                                     th:text="${(current+5)}">5</a></li>
                            <li class="page-item"><a class="page-link"
                                                     th:href="${'/easywk?current='+(current+1)}">下一页</a></li>
                        </ul>
                    </nav>
                </div>
            </div>
        </div>
        <th:block th:include="adultexam/footer"/>
    </div>
</div>
</div>


<script>
    $(function () {
            $(".navs .active").removeClass("active");
            $(".easywk").addClass("active");

            $("#button-addon2").click(function () {
                window.open('/easywk?current=1&keyword=' + $("#keyword").val()+'&course=' + $("#course").val(), '_self')
            })
        }
    )
</script>
</body>

</html>
